#region
/* Adoor.NET - Object/Relational mapping framework leveraging ADO.NET`s powerful disconnected mode.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *  
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *  
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */ 
#endregion

using System;
using System.Collections.Generic;
using Adoor.Object.Domain;
using Adoor.Object.Query;

namespace Adoor.Object.Entity
{
	/// <summary>
	/// The specification of what to clone with the method <see cref="IObjectStorage.Clone"/>.
	/// </summary>
	public enum CloneMode { Empty, NoData, NewData, Full }

    public interface ICacheCommitable
    {
        void CommitLocalCache();
    }

	/// <summary>
	/// An interface supported by objects capable of creating and storing entities, in addition to the capabilities provided by
	/// interface <see cref="IObjectSource"/>.
	/// </summary>
	public interface IObjectStorage: IObjectSource
	{
		IServiceProvider ServiceProvider { get; set; }

		string GetXml();

		IObjectStorage Clone(CloneMode mode);

		void Clear();
		void Cancel();

		object Create(Type type, params object[] args);
        T Create<T>(params object[] args);
		object Find(Type baseType, string oid);
		object Find(EntityData entityData, string oid);
        T Find<T>(Type baseType, string oid);
        T Find<T>(EntityData entityData, string oid);

        System.Collections.ICollection Collect(Type type);
        System.Collections.ICollection Collect(string query, System.Collections.Generic.IDictionary<string, object> dicArgs);
        System.Collections.ICollection Collect(ObjectQuery query, params object[] args);
        System.Collections.ICollection Collect(ObjectQuery query, System.Collections.Generic.IDictionary<string, object> args);
        System.Collections.ICollection Collect(ObjectQuery query, object args);
        System.Collections.ICollection Collect(string query, params object[] args);
		bool CheckIntegrity {get; set;}
		string Name { get; }

        void Enlist();
    }
}
